<?php
// +----------------------------------------------------------------------
// | KITEGO-Admin「开箱即用」「人人全栈」
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.kitego.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed KITEGO并不是自由软件，未经许可不能去掉KITEGO相关版权
// +----------------------------------------------------------------------
// | Author: KITEGO Team <bd@kitego.cn>
// +----------------------------------------------------------------------

use app\adminapi\middleware\AdminLoginMiddleware;
use think\facade\Route;

Route::group('passport', function () {
    // 无需登录
    Route::group(function () {
        Route::get('getCaptcha', 'v1.passport.PassportController/getCaptcha')->option(['real_name' => '获取验证码']);
        Route::get('getClickCaptcha', 'v1.passport.PassportController/getClickCaptcha')->option(['real_name' => '获取点击验证码']);
        Route::post('getToken', 'v1.passport.PassportController/getToken')->option(['real_name' => '登录获取TOKEN']);
        Route::post('refreshToken', 'v1.passport.PassportController/refreshToken')->option(['real_name' => '刷新token']);
        Route::get('getSysConfigByGuest', 'v1.setting.config.SystemConfigController/getSysConfigByGuest')->option(['realName' => '获取系统非敏感配置项']);
        Route::post('applySystemAdmin', 'v1.setting.SystemAdminController/applySystemAdmin')->option(['realName' => '申请成为管理员']);
    })->option(['parent' => 'passport', 'cate_name' => '登录模块']);

    Route::group(function () {
        Route::get('getSystemMenu', 'v1.setting.SystemMenuController/getSystemMenu')->option(['realName' => '登录获取系统菜单']);
        Route::post('logout', 'v1.passport.PassportController/logout')->option(['real_name' => '退出登录']);
        Route::post('forceLogout', 'v1.passport.PassportController/logout')->option(['real_name' => '强制注销']);
    })->option(['parent' => 'passport', 'cate_name' => '登录模块']);


})->middleware([])->option(['mark' => 'passport', 'mark_name' => '登录相关']);